package com.neutech.neurfin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neurfin.service.FinService;
import com.neutech.po.FinUser;

@RestController
@RequestMapping(value="/his")
public class FinController {
	@Autowired
	private FinService finService;
	
	
	@RequestMapping("/getFinById")
	 public @ResponseBody FinUser getUser(Integer id){
		FinUser use = finService.getUser(id);
		return use;
	}
	
	@RequestMapping(value="/addFin",method=RequestMethod.POST)
	public String addUser(FinUser finuser){
		finService.addFin(finuser);
		return "添加成功";
	}
	
	@RequestMapping(value="/updateFin",method=RequestMethod.POST)
	  public String updateFin(FinUser finuser){
		finService.updateFin(finuser);
		return "修改成功";
	}
	@RequestMapping(value="/delectFinById",method=RequestMethod.POST)
	  public String delectFinById(int id){
		finService.delectFinById(id);
		return "删除成功";
	}
 
}
